-
-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(changelog): expose commit parents #1376
base: master
Are you sure you want to change the base?
feat(changelog): expose commit parents #1376
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1376 +/- ##
==========================================
+ Coverage 97.33% 97.55% +0.21%
==========================================
Files 42 57 +15
Lines 2104 2656 +552
==========================================
+ Hits 2048 2591 +543
- Misses 56 65 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution.
Good to me after the default list handling is fixed 👍🏼
@@ -507,6 +507,7 @@ Each `Change` has the following fields: | |||
| scope | `str | None` | An optional scope | | |||
| message | `str` | The commit message body | | |||
| sha1 | `str` | The commit `sha1` | | |||
| parents | `list[str]` | The parent commit(s) `sha1`(s) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add more information to this section, specially what's it useful for:
Example usage: generate changelogs based on merge commits only, or listing commits that belong to the same PR under its own section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added similar phrasing just below this table after the note. Let me know if that's ok.
LGTM! After issues have been addressed we can merge, thanks! |
COMMIT_DATA in test_changelog.py had to be type annotated to avoid an issue with mypy linting when creating a GitCommit where the tool would expect the wrong type for the arguments.
b8d8ab7
to
ca410a4
Compare
Description
Expose commit parent(s) digests to the changelog process. This has an application
for projects that want to generate changelogs based on merge commits only, but it
is likely useful in more contexts, for example listing commits that belong to the same
PR under its own section.
Checklist
poetry all
locally to ensure this change passes linter check and testExpected behavior
The changelog generation code exposes the
parents
field with a list of parentdigests in git commits.
Steps to Test This Pull Request
You can create a changelog template iterating the
parents
field of changes andfor merge commits you should have at least 2 parents.
Additional context
Useful in the git workflow I'm currently working on, where merge commits cannot
be told apart by the changelog generation machinery and I need to distinguish them
as they are the only ones that can be taken into account without rewriting the project's
git history due to using varied standards throughout its life.